﻿<%@ Page Title="Redirect entries" Language="C#" MasterPageFile="~/Administration/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Administration_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" runat="Server">
    <asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1">
        <EmptyDataTemplate>
            <p>No redirect entries defined.</p>
            <p>
                <altairis:IconHyperLink ID="IconHyperLink1" runat="server" Icon="LinkAdd" Text="Create new redirect" NavigateUrl="Detail.aspx" CssClass="strong" />
            </p>
        </EmptyDataTemplate>
        <LayoutTemplate>
            <table class="grid">
                <thead>
                    <tr>
                        <th>Location</th>
                        <th>Target</th>
                        <th>Redirect Type</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="newitem" colspan="3">
                            <altairis:IconHyperLink ID="IconHyperLink1" runat="server" Icon="LinkAdd" Text="New redirect" NavigateUrl="Detail.aspx" CssClass="strong" />
                        </td>
                    </tr>
                    <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                </tbody>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <altairis:IconHyperLink ID="IconHyperLink1" runat="server" Icon="LinkEdit" Text='<%# Eval("Location") %>' NavigateUrl='<%# Eval("EntryId", "Detail.aspx?EntryId={0}") %>' CssClass="strong" />
                </td>
                <td>
                    <altairis:EllipsisHyperLink ID="EllipsisHyperLink1" runat="server" Text='<%# Eval("RedirectLocation") %>' NavigateUrl='<%# Eval("RedirectLocation") %>' MaximumTextLength="50" />
                </td>
                <td>
                    <asp:Literal ID="Literal1" runat="server" Text='<%# Eval("RedirectType.Title") %>' />
                </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SwitchboardDataContext" OrderBy="Host.HostName, LocalPath" TableName="Entries" Where="Host.UserName == @UserName">
        <WhereParameters>
            <altairis:UserNameParameter Name="UserName" Type="String" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
